class Professor(UserMixin, db.Model):
    __tablename__ = "professor"

    professor_id = db.Column(db.Integer, primary_key=True, unique=True)
    password_hash = db.Column(db.String(128))
    professor_name = db.Column(db.String(8))
    date_of_birth = db.Column(db.DateTime)
    social_security_number = db.Column(db.String(8))
    status = db.Column(db.String(8))
    department = db.Column(db.String(20))
    teaches = db.relationship("Teaches", backref="professor")

    def __init__(self, **kwargs):
        super(Professor, self).__init__(**kwargs)

    @property
    def password(self):
        raise AttributeError('password is not a readable attribute')

    @password.setter
    def password(self, password):
        self.password_hash = generate_password_hash(password)

    def verify_password(self, password):
        return check_password_hash(self.password_hash, password)

    def get_id(self):
        return self.professor_id

    def get_name(self):
        return self.professor_name

    def is_student(self):
        return False

    def is_professor(self):
        return True

    def is_registrar(self):
        return False